export function Map(ak) {
    return new Promise((resolve, reject) => {
        // @ts-ignore
        window.init = () => {
            // @ts-ignore
            resolve(BMap);
        };
        const script = document.createElement("script");
        script.type = "text/javascript";
        script.src = "https://api.map.baidu.com/api?v=2.0&ak=" + ak + "&callback=init";
        script.onerror = reject;
        document.head.appendChild(script);
    });
}
